﻿#ifndef MAINWIDGET_H
#define MAINWIDGET_H

#include <QWidget>
#include <QFileInfo>

#include "videodevice.h"
#include "videothread.h"
#include "diskthread.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWidget; }
QT_END_NAMESPACE

class MainWidget : public QWidget
{
    Q_OBJECT

public:
    explicit MainWidget(QWidget *parent = nullptr);
    ~MainWidget();

private slots:
    void on_videoBtn_clicked();
    void on_paushBtn_clicked();
    void on_pictureBtn_clicked();
    void on_refreshBtn_clicked();

    void pictureFinishSlot(void);
    void videoFinishSlot(void);
    void diskStatusSlot(DiskThread::DiskStatus status, const QString & path);

private:
    void recordStart(void);
    void recordStop(void);

private:
    Ui::MainWidget *ui;
    VideoDevice * m_videoDevice;

    VideoThread * videoThread;
    PictureThread * pictureThread;
    DiskThread * m_diskThread;

    QString diskPath = "";
};
#endif // MAINWIDGET_H
